package br.unip.tcc.domotic.orm;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@Table(name = "tipo_residencia")
public class HomeType extends AbstractORM {
	
	private static final long serialVersionUID = 1L;
	
	private Integer homeTypeId;
	private String homeTypeDescription;
	private Set<Home> homes = new HashSet<Home>(0);
	
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name = "cod_tipo_residencia", unique = true, nullable = false)
	public Integer getHomeTypeId() {
		return homeTypeId;
	}
	
	public void setHomeTypeId(Integer homeTypeId) {
		this.homeTypeId = homeTypeId;
	}
	
	@Column(name = "des_tipo_residencia", nullable = false)
	public String getHomeTypeDescription() {
		return homeTypeDescription;
	}
	
	public void setHomeTypeDescription(String homeTypeDescription) {
		this.homeTypeDescription = homeTypeDescription;
	}
	
	@OneToMany(fetch = FetchType.LAZY, mappedBy = "homeType")
	public Set<Home> getHomes() {
		return homes;
	}
	
	public void setHomes(Set<Home> homes) {
		this.homes = homes;
	}
	
}
